<?php
namespace app\admin\controller;
use think\Db;
class Common extends Base{
    public function welcome(){
        $views=Db::name('views')->where('time','>',0)->count();
        $views_today=Db::name('views')->where('uptime','>=',strtotime(date('Y-m-d',time())))->count();
        $message=Db::name('message')->where('time','>',0)->count();
        $message_today=Db::name('message')->where('time','>=',strtotime(date('Y-m-d',time())))->count();
        $resume=Db::name('resume')->where('time','>',0)->count();
        $resume_today=Db::name('resume')->where('time','>=',strtotime(date('Y-m-d',time())))->count();
        $views_item=Db::name('views')->where('time','>',0)->order('id desc')->limit(10)->select();
        $this->assign('views',$views);
        $this->assign('views_today',$views_today);
        $this->assign('message',$message);
        $this->assign('message_today',$message_today);
        $this->assign('resume',$resume);
        $this->assign('resume_today',$resume_today);
        $this->assign('views_item',$views_item);
        return $this->fetch();
    }
}
